function stockResearch(stockResearch){
	var myChart = echarts.init(document.getElementById('stockResearch'));
	stockResearch = JSON.parse(stockResearch);
	var list = stockResearch.data;
	var time = [];//时间
	var capitalExpense = [];//研发支出资本化金额
	var pctg = [];//与营收之比（右轴）
	var costExpense = [];//研发支出费用化金额
	for (var i = 0; i < list.length; i++) {
		time.push(list[i].year);
		var num=(list[i].capitalExpense/100000000).toFixed(2);
		capitalExpense.push(num);
		if(!list[i].pctg){
			pctg.push("-");
		}else{
			pctg.push(list[i].pctg.toFixed(2));
		}
		var nums = (list[i].costExpense/100000000).toFixed(2);
		costExpense.push(nums);
	}
	
	var max = Math.max.apply(null,capitalExpense) + 10;
	var max1 = Math.max.apply(null,pctg) + 10;
	/*var mins = Math.min.apply(null,niAttrPCutYOY);*/
	
	option = {
	    backgroundColor: "#fff",
	    "title": {
	        "text": "研发投入占比",
	        //"subtext": "BY Wang Dingding",
	        //x: "4%",

	        textStyle: {
	            color: '#283b56',
	            fontSize: '18'
	        },
	        subtextStyle: {
	            color: '#90979c',
	            fontSize: '16',

	        },
	    },
	    "tooltip": {
	        "trigger": "axis",
	        "axisPointer": {
	            "type": "shadow",
	            textStyle: {
	                color: "#fff"
	            }

	        },
	    },
	    "grid": {
	        "borderWidth": 0,
	        /*"top": 110,
	        "bottom": 95,*/
	        textStyle: {
	            color: "#fff"
	        }
	    },
	    "legend": {
	    	x: '30%',
	        textStyle: {
	            color: '#90979c',
	        },
	        "data": ['研发支出资本化金额', '研发支出费用化金额', '与营收之比（右轴）']
	    },
	     

	    "calculable": true,
	    "xAxis": [{
	        "type": "category",
	        "axisLine": {
	            lineStyle: {
	                color: '#90979c'
	            }
	        },
	        "splitLine": {
	            "show": false
	        },
	        "axisTick": {
	            "show": false
	        },
	        "splitArea": {
	            "show": false
	        },
	        "axisLabel": {
	            "interval": 0,

	        },
	        "data": time,
	    }],
	    "yAxis": [{
            type: 'value',
            scale: true,
            name: '亿',
            max: max,
            min: 0,
            boundaryGap: [0.2,0.2],
            formatter: '{value} %'  
        },
        {
            type: 'value',
            scale: true,
            name: '%',
            max: max1,
            min: 0,
            boundaryGap: [0.2, 0.2]
        }],
	    
	    "series": [{
	            "name": "研发支出资本化金额",
	            "type": "bar",
	            "stack": "总量",
	            "barMaxWidth": 35,
	            "barGap": "10%",
	            "itemStyle": {
	                "normal": {
	                    "color": "rgba(255,144,128,1)",
	                    "label": {
	                        "show": true,
	                        "textStyle": {
	                            "color": "#fff"
	                        },
	                        "position": "insideTop",
	                        formatter: function(p) {
	                            return p.value > 0 ? (p.value) : '';
	                        }
	                    }
	                }
	            },
	            "data": capitalExpense
	        },

	        {
	            "name": "研发支出费用化金额",
	            "type": "bar",
	            "stack": "总量",
	            "itemStyle": {
	                "normal": {
	                    "color": "rgba(0,191,183,1)",
	                    "barBorderRadius": 0,
	                    "label": {
	                        "show": true,
	                        "position": "top",
	                        formatter: function(p) {
	                            return p.value > 0 ? (p.value) : '';
	                        }
	                    }
	                }
	            },
	            "data": costExpense
	        }, {
	            "name": "与营收之比（右轴）",
	            "type": "line",
	            "stack": "总量",
	            symbolSize:10,
	            symbol:'circle',
	            "itemStyle": {
	                "normal": {
	                    "color": "rgba(252,230,48,1)",
	                    "barBorderRadius": 0,
	                    "label": {
	                        "show": true,
	                        "position": "top",
	                        formatter: function(p) {
	                            return p.value > 0 ? (p.value) : '';
	                        }
	                    }
	                }
	            },
	            "data": pctg
	        },
	    ]
	};


	if (option && typeof option === "object") {
	    myChart.setOption(option, true);
	}
	
}


function strNumSize(tempNum) {
    var stringNum = tempNum.toString();
    var index = stringNum.indexOf(".");
    var newNum = stringNum;
    if(index != -1) {
        newNum = stringNum.substring(0, index)
    };
    return newNum.length;
}
function unitConvert(num) {
    var moneyUnits = ["", "万", "亿", "万亿"];
    var dividend = 10000;
    var curentNum = num;
    //转换数字
    var curentUnit = moneyUnits[0];
    //转换单位 
    for(var i = 0; i < 4; i++) {
        curentUnit = moneyUnits[i];
        if(strNumSize(curentNum) < 5) {
            break;
        };
        curentNum = curentNum / dividend;
    };
    var m = {
        num: 0,
        unit: ""
    };
    m.num = curentNum.toFixed(2);
    m.unit = curentUnit;
    return m;
}